package homework;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;


public class producer {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("new_pud_group");
        producer.setNamesrvAddr("localhost:9876");

        producer.start();

        Message message = new Message("p",
                "sad",
                "郑州人和".getBytes(StandardCharsets.UTF_8));

        SendResult send = producer.send(message);
        System.out.println(send);
        producer.shutdown();
    }
}
